﻿@model Citi.Scheduler.WebUi.Models.MachineModel
<script type="text/javascript">
    function closeDialogMachine() {
        $("#divUpdateMachine").dialog('close');
        clearForm();
    }

    function clearForm() {
        $("#formActionForm").trigger('reset');
    }
</script>
@using (Ajax.BeginForm("ActionForm", "Machine", new AjaxOptions
{
    UpdateTargetId = "divIndexMachine",
    InsertionMode = InsertionMode.Replace,
    OnComplete = "closeDialogMachine"
}, new { id = "formActionForm" }))
{
    <div class="editor-label">
        @Html.LabelFor(model => model.HostName)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.HostName)
        @Html.ValidationMessageFor(model => model.HostName)
    </div>

    if (Model != null)
    {
    @Html.HiddenFor(model => model.Id)
    }
    <p>
        <input type="submit" value="Save" />
    </p>
}
